Pushover Agent. Added ability to have a default message. Made some stylistic changes as well.

akil harris 11 年之前
父节点
当前提交
5b65372b39
共有 2 个文件被更改,包括 2 次插入7 次删除
  1. 2 2
      app/models/agents/pushover_agent.rb
  2. 0 5
      spec/models/agents/pushover_agent_spec.rb

+ 2 - 2
app/models/agents/pushover_agent.rb

@@ -51,8 +51,8 @@ module Agents
51 51
     end
52 52
 
53 53
     def validate_options
54
-      unless options['token'].present? && options['user'].present? && options['message'].present? && options['expected_receive_period_in_days'].present?
55
-        errors.add(:base, 'token, user, message, and expected_receive_period_in_days are all required.')
54
+      unless options['token'].present? && options['user'].present? && options['expected_receive_period_in_days'].present?
55
+        errors.add(:base, 'token, user, and expected_receive_period_in_days are all required.')
56 56
       end
57 57
     end
58 58
 

+ 0 - 5
spec/models/agents/pushover_agent_spec.rb

@@ -179,11 +179,6 @@ describe Agents::PushoverAgent do
179 179
       @checker.should_not be_valid
180 180
     end
181 181
 
182
-    it "should validate presence of message" do
183
-      @checker.options[:message] = ""
184
-      @checker.should_not be_valid
185
-    end
186
-
187 182
     it "should validate presence of expected_receive_period_in_days" do
188 183
       @checker.options[:expected_receive_period_in_days] = ""
189 184
       @checker.should_not be_valid